/**
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 *
 * The Initial Developer of the Original Code is sephiroth.it
 *
 * Contributor(s):
 *   Gabriele Farina <gabriele@sephiroth.it>
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 */
package it.sephiroth.gettext
{
	import flash.utils.Dictionary;

	/**
	 * Readable english language names for the corresponding ISO 639
	 * language codes.
	 * 
	 * @author Gabriele Farina <gabriele@sephiroth.it>
	 * 
	 */
	public final class ISO639
	{
		public static var names: Dictionary = null;
		
		/**
		 * Retrieve a readable english language name for the given ISO 639 
		 * language code.
		 * 
		 * @param	id	The ISO 639 language code
		 * @return 		The readable english name for the given language code, or null
		 * 
		 */
		public static function getLanguageName( id: String ): String
		{
			if( null == names )
			{
				names = new Dictionary();
				
				names[ 'aa' ] = 'Afar. ';
				names[ 'ab' ] = 'Abkhazian';
				names[ 'ae' ] = 'Avestan';
				names[ 'af' ] = 'Afrikaans';
				names[ 'am' ] = 'Amharic';
				names[ 'ar' ] = 'Arabic';
				names[ 'as' ] = 'Assamese';
				names[ 'ay' ] = 'Aymara';
				names[ 'az' ] = 'Azerbaijani';
				names[ 'ba' ] = 'Bashkir';
				names[ 'be' ] = 'Byelorussian; Belarusian';
				names[ 'bg' ] = 'Bulgarian';
				names[ 'bh' ] = 'Bihari';
				names[ 'bi' ] = 'Bislama';
				names[ 'bn' ] = 'Bengali; Bangla';
				names[ 'bo' ] = 'Tibetan';
				names[ 'br' ] = 'Breton';
				names[ 'bs' ] = 'Bosnian';
				names[ 'ca' ] = 'Catalan';
				names[ 'ce' ] = 'Chechen';
				names[ 'ch' ] = 'Chamorro';
				names[ 'co' ] = 'Corsican';
				names[ 'cs' ] = 'Czech';
				names[ 'cu' ] = 'Church Slavic';
				names[ 'cv' ] = 'Chuvash';
				names[ 'cy' ] = 'Welsh';
				names[ 'da' ] = 'Danish';
				names[ 'de' ] = 'German';
				names[ 'dz' ] = 'Dzongkha; Bhutani';
				names[ 'el' ] = 'Greek';
				names[ 'en' ] = 'English';
				names[ 'eo' ] = 'Esperanto';
				names[ 'es' ] = 'Spanish';
				names[ 'et' ] = 'Estonian';
				names[ 'eu' ] = 'Basque';
				names[ 'fa' ] = 'Persian';
				names[ 'fi' ] = 'Finnish';
				names[ 'fj' ] = 'Fijian; Fiji';
				names[ 'fo' ] = 'Faroese';
				names[ 'fr' ] = 'French';
				names[ 'fy' ] = 'Frisian';
				names[ 'ga' ] = 'Irish';
				names[ 'gd' ] = 'Scots; Gaelic';
				names[ 'gl' ] = 'Gallegan; Galician';
				names[ 'gn' ] = 'Guarani';
				names[ 'gu' ] = 'Gujarati';
				names[ 'gv' ] = 'Manx';
				names[ 'ha' ] = 'Hausa (?)';
				names[ 'he' ] = 'Hebrew (formerly iw)';
				names[ 'hi' ] = 'Hindi';
				names[ 'ho' ] = 'Hiri Motu';
				names[ 'hr' ] = 'Croatian';
				names[ 'hu' ] = 'Hungarian';
				names[ 'hy' ] = 'Armenian';
				names[ 'hz' ] = 'Herero';
				names[ 'ia' ] = 'Interlingua';
				names[ 'id' ] = 'Indonesian (formerly in)';
				names[ 'ie' ] = 'Interlingue';
				names[ 'ik' ] = 'Inupiak';
				names[ 'io' ] = 'Ido';
				names[ 'is' ] = 'Icelandic';
				names[ 'it' ] = 'Italian';
				names[ 'iu' ] = 'Inuktitut';
				names[ 'ja' ] = 'Japanese';
				names[ 'jv' ] = 'Javanese';
				names[ 'ka' ] = 'Georgian';
				names[ 'ki' ] = 'Kikuyu';
				names[ 'kj' ] = 'Kuanyama';
				names[ 'kk' ] = 'Kazakh';
				names[ 'kl' ] = 'Kalaallisut; Greenlandic';
				names[ 'km' ] = 'Khmer; Cambodian';
				names[ 'kn' ] = 'Kannada';
				names[ 'ko' ] = 'Korean';
				names[ 'ks' ] = 'Kashmiri';
				names[ 'ku' ] = 'Kurdish';
				names[ 'kv' ] = 'Komi';
				names[ 'kw' ] = 'Cornish';
				names[ 'ky' ] = 'Kirghiz';
				names[ 'la' ] = 'Latin';
				names[ 'lb' ] = 'Letzeburgesch';
				names[ 'ln' ] = 'Lingala';
				names[ 'lo' ] = 'Lao; Laotian';
				names[ 'lt' ] = 'Lithuanian';
				names[ 'lv' ] = 'Latvian; Lettish';
				names[ 'mg' ] = 'Malagasy';
				names[ 'mh' ] = 'Marshall';
				names[ 'mi' ] = 'Maori';
				names[ 'mk' ] = 'Macedonian';
				names[ 'ml' ] = 'Malayalam';
				names[ 'mn' ] = 'Mongolian';
				names[ 'mo' ] = 'Moldavian';
				names[ 'mr' ] = 'Marathi';
				names[ 'ms' ] = 'Malay';
				names[ 'mt' ] = 'Maltese';
				names[ 'my' ] = 'Burmese';
				names[ 'na' ] = 'Nauru';
				names[ 'nb' ] = 'Norwegian Bokmål';
				names[ 'nd' ] = 'Ndebele, North';
				names[ 'ne' ] = 'Nepali';
				names[ 'ng' ] = 'Ndonga';
				names[ 'nl' ] = 'Dutch';
				names[ 'nn' ] = 'Norwegian Nynorsk';
				names[ 'no' ] = 'Norwegian';
				names[ 'nr' ] = 'Ndebele, South';
				names[ 'nv' ] = 'Navajo';
				names[ 'ny' ] = 'Chichewa; Nyanja';
				names[ 'oc' ] = 'Occitan; Provençal';
				names[ 'om' ] = '(Afan) Oromo';
				names[ 'or' ] = 'Oriya';
				names[ 'os' ] = 'Ossetian; Ossetic';
				names[ 'pa' ] = 'Panjabi; Punjabi';
				names[ 'pi' ] = 'Pali';
				names[ 'pl' ] = 'Polish';
				names[ 'ps' ] = 'Pashto, Pushto';
				names[ 'pt' ] = 'Portuguese';
				names[ 'qu' ] = 'Quechua';
				names[ 'rm' ] = 'Rhaeto-Romance';
				names[ 'rn' ] = 'Rundi; Kirundi';
				names[ 'ro' ] = 'Romanian';
				names[ 'ru' ] = 'Russian';
				names[ 'rw' ] = 'Kinyarwanda';
				names[ 'sa' ] = 'Sanskrit';
				names[ 'sc' ] = 'Sardinian';
				names[ 'sd' ] = 'Sindhi';
				names[ 'se' ] = 'Northern Sami';
				names[ 'sg' ] = 'Sango; Sangro';
				names[ 'si' ] = 'Sinhalese';
				names[ 'sk' ] = 'Slovak';
				names[ 'sl' ] = 'Slovenian';
				names[ 'sm' ] = 'Samoan';
				names[ 'sn' ] = 'Shona';
				names[ 'so' ] = 'Somali';
				names[ 'sq' ] = 'Albanian';
				names[ 'sr' ] = 'Serbian';
				names[ 'ss' ] = 'Swati; Siswati';
				names[ 'st' ] = 'Sesotho; Sotho, Southern';
				names[ 'su' ] = 'Sundanese';
				names[ 'sv' ] = 'Swedish';
				names[ 'sw' ] = 'Swahili';
				names[ 'ta' ] = 'Tamil';
				names[ 'te' ] = 'Telugu';
				names[ 'tg' ] = 'Tajik';
				names[ 'th' ] = 'Thai';
				names[ 'ti' ] = 'Tigrinya';
				names[ 'tk' ] = 'Turkmen';
				names[ 'tl' ] = 'Tagalog';
				names[ 'tn' ] = 'Tswana; Setswana';
				names[ 'to' ] = 'Tonga';
				names[ 'tr' ] = 'Turkish';
				names[ 'ts' ] = 'Tsonga';
				names[ 'tt' ] = 'Tatar';
				names[ 'tw' ] = 'Twi';
				names[ 'ty' ] = 'Tahitian';
				names[ 'ug' ] = 'Uighur';
				names[ 'uk' ] = 'Ukrainian';
				names[ 'ur' ] = 'Urdu';
				names[ 'uz' ] = 'Uzbek';
				names[ 'vi' ] = 'Vietnamese';
				names[ 'vo' ] = 'Volapük; Volapuk';
				names[ 'wa' ] = 'Walloon';
				names[ 'wo' ] = 'Wolof';
				names[ 'xh' ] = 'Xhosa';
				names[ 'yi' ] = 'Yiddish (formerly ji)';
				names[ 'yo' ] = 'Yoruba';
				names[ 'za' ] = 'Zhuang';
				names[ 'zh' ] = 'Chinese';
				names[ 'zh_tw' ] = 'Chinese Transitional';
				names[ 'zh_cn' ] = 'Chinese Simplified';
				names[ 'zu' ] = 'Zulu';
			}
			
			return names[ id ];
		}
	}
}